# coding:utf8

dbcfg = {
    'bind':{'host':'127.0.0.1', 'port':6379,'db':0,'password':''},
    'wxbind':{'host':'127.0.0.1', 'port':6379,'db':1,'password':''},
    'wxsign':{'host':'127.0.0.1', 'port':6379,'db':2,'password':''},
}

def getdb(dbname):
    if dbname not in cfg:
        return
    cfg = dbcfg[dbname]
    redb = redis.StrictRedis(cfg['host'], cfg['port'], db=cfg['db'], passwrod=cfg['password'], decode_responses=True)
    return redb
